﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace STKMIS.Model
{
    /// <summary>
    /// 的实体类
    /// </summary>
    [Serializable]
    public class PurchaseItemModel
    {
        // 常量
        public const string tableName = "PurchaseItem";
        public const string primaryKeyName = "PurchaseItemID";

        // 成员变量
        private int _purchaseItemID;
        private int _purchaseID;
        private int _productID;
        private int _productUnitID;
        private decimal _productAmount;
        private decimal _productPrice;
        private decimal _purchaseMoney;

        /// <summary>
        /// 字段名结构
        /// <summary>
        public struct FieldName
        {
            public const string purchaseItemID = "PurchaseItemID";
            public const string purchaseID = "PurchaseID";
            public const string productID = "ProductID";
            public const string productUnitID = "ProductUnitID";
            public const string productAmount = "ProductAmount";
            public const string productPrice = "ProductPrice";
            public const string purchaseMoney = "PurchaseMoney";
        }

        /// <summary>
        /// 默认构造函数
        /// <summary>
        public PurchaseItemModel() { }

        /// <summary>
        /// 带参构造函数
        /// <summary>
        ///<param name="purchaseItemID">采购明细ID（主键）</param>
        ///<param name="purchaseID">采购ID</param>
        ///<param name="productID">产品ID</param>
        ///<param name="purchaseMoney">采购金额</param>
        public PurchaseItemModel(int purchaseItemID, int purchaseID, int productID,int productUnitID,decimal productAmount,decimal productPrice, decimal purchaseMoney)
        {
            this._purchaseItemID = purchaseItemID;
            this._purchaseID = purchaseID;
            this._productID = productID;
            this._productUnitID = productUnitID;
            this._productAmount = productAmount;
            this._productPrice = productPrice;
            this._purchaseMoney = purchaseMoney;
        }

        /// <summary>
        /// 采购明细ID（主键）
        /// <summary>
        public int PurchaseItemID
        { 
            get { return _purchaseItemID; }
            set { _purchaseItemID = value; }
        }

        /// <summary>
        /// 采购ID
        /// <summary>
        public int PurchaseID
        { 
            get { return _purchaseID; }
            set { _purchaseID = value; }
        }

        /// <summary>
        /// 产品ID
        /// <summary>
        public int ProductID
        { 
            get { return _productID; }
            set { _productID = value; }
        }

        /// <summary>
        /// 产品单位
        /// <summary>
        public int ProductUnitID
        {
            get { return _productUnitID; }
            set { _productUnitID = value; }
        }

        /// <summary>
        /// 采购产品数量
        /// <summary>
        public decimal ProductAmount
        {
            get { return _productAmount; }
            set { _productAmount = value; }
        }

        /// <summary>
        /// 采购产品单价
        /// <summary>
        public decimal ProductPrice
        {
            get { return _productPrice; }
            set { _productPrice = value; }
        }

        /// <summary>
        /// 采购金额
        /// <summary>
        public decimal PurchaseMoney
        { 
            get { return _purchaseMoney; }
            set { _purchaseMoney = value; }
        }

        public List<ProductsAndUnitModel> ProductsAndUnitList { get; set; }
    }
}
